<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>vue应用</title>
    <script src="./js/vue (2).js"></script>
</head>

<body>
    <div id="app">
        {{name}}
        {{say()}}
        {{person.name}}
        {{person.age>=18?"helloWorld":"hello"}}
        <h1 v-html="htmlHref"></h1>
        <button @click="updateUrl">点击改变</button>
        <a :href="url">百度</a>
        <button @click="show=!show">简易折叠菜单</button>
        <div v-show="show">
            <h1>helloWorld</h1>
        </div>
    </div>
    <script>
        const app = new Vue({
            el: "#app",
            data: {
                name: "张三",
                person: { name: "小明", age: 18 },
                htmlHref: `<a href="http://www.baidu.com">百度一下</a>`,
                url: "http://www.baidu.com",
                show: false,

            },
            mounted() {
                console.log(11111111111111111);
            },
            methods: {
                say: function () {
                    return `大家好,我是${this.name}`
                },
                updateUrl: function () {
                    this.url = "https://api.aa1.cn/"
                }

            }
        });
    </script>

</body>

</html>